dojo.provide("dojot.util.PageList");
dojo.experimental("dojot.util.PageList");

dojo.require("dojot.util.PageInfo");
dojo.require("dojot.util.PageDataStore");
dojo.declare("dojot.util.PageList",null,{
	pageInfo:null,
	items:null,
	next:false,
	prev:false,
	nextIndex:0,
	prevIndex:0,
	isMemoryPage:false, 
	listPageIndex:[],  
	pageDataStore:null,
	cleanPageInfo: function(){
		this.pageInfo.currentPage = 1;
	},
	initTurnPageInfo: function(){
		this.next = this.isShowNext();
		this.prev = this.isShowPrev();
		this.nextIndex = this.pageInfo.currentPage+1;
		this.endIndex = this.pageInfo.currentPage-1;
		//初始化页码导航条中列出的页数 的数组，方便在模板里面显示使用
		this.listPageIndex = [];
		for(var start=this._getListPageStart(),end=this._getListPageEnd();start<=end;start++){
			this.listPageIndex.push(start);
		}
	},
	isShowNext:function(){
		this.nextIndex = this.pageInfo.currentPage + 1;
		return this.pageInfo.currentPage < this.pageInfo.pageCount;
	},
	isShowPrev:function(){
		this.prevIndex = this.pageInfo.currentPage - 1;
		return this.pageInfo.currentPage > 1;
	},
	showIndex: function(currentPage){
		this._setCurrentPage(currentPage);
		this._setPage();
	},
	_setCurrentPage:function(){
		throw new Error('dojot.util.PageList Unimplemented Memthod');
	},
	_setPage:function(){
		throw new Error('dojot.util.PageList Unimplemented Memthod');
	},
	_getListPageStart: function(){
		throw new Error('dojot.util.PageList Unimplemented Memthod');
	},
	_getListPageEnd: function(){
		throw new Error('dojot.util.PageList Unimplemented Memthod');
	}
})